home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / PowerPlant / CDragAndDrop / CDragAndDrop.h < prev    next >
Encoding:
Text File  |  1995-02-09  |  2.0 KB  |  60 lines  |  [TEXT/CWIE]

  1. // ============================================================================
  2. //    CDragAndDrop.h       ©1995 J. Rodden, DD/MF & Associates. All rights reserved
  3. // ============================================================================
  4. // CDragAndDrop picks up drag manager handling where LDragAndDrop leaves off.
  5. // Everything necessary for a drag and droppable pane is encapsulated in this
  6. // class. 
  7. // ============================================================================
  8.  
  9. #pragma once
  10.  
  11. #include "CDragItem.h"
  12.  
  13. #include <LDragAndDrop.h>
  14. #include <LView.h>
  15.  
  16. class LDragTask;
  17.  
  18. class    CDragAndDrop : public LDragAndDrop,
  19.                        public CDragItem {
  20.  
  21.     friend class CDragTask;
  22.     
  23. public:
  24.                     CDragAndDrop(WindowPtr inMacWindow, LPane *inPane);
  25.                     
  26. protected:
  27.     virtual Boolean    ClickIsDragEvent(const SMouseDownEvent &inMouseDown, Rect* inRect = nil);
  28.     virtual void    CreateDragEvent(const SMouseDownEvent &inMouseDown, Rect* inRect = nil);
  29.     
  30.     virtual void    SetLocalFrame();
  31.  
  32.     virtual Boolean    ItemIsAcceptable( DragReference inDragRef, ItemReference inItemRef);
  33.                                     
  34.     virtual void    LeaveDropArea (DragReference inDragRef);
  35.     virtual void    InsideDropArea( DragReference inDragRef);
  36.     virtual void    InsideDropArea( DragReference inDragRef, Point& theMouseLocation,
  37.                                     Point& thePinnedLocation);
  38.     
  39.     virtual void    ReceiveDragItem( DragReference inDragRef, DragAttributes inDragAttrs,
  40.                                      ItemReference inItemRef, Rect& inItemBounds);
  41.     
  42.     virtual    void    ReceiveDragItem( DragReference inDragRef, ItemReference inItemRef,
  43.                                       Size inDataSize, Boolean inCopyData, 
  44.                                       Boolean inFromFinder, Rect& inItemBounds);
  45.     
  46.     virtual void    RemoveDragItem(const SMouseDownEvent &inMouseDown);
  47.     
  48.     Rect            mLocalFrame;
  49.     FlavorType        mFlavorAccepted;
  50.     long            mFlavorSize;
  51.     Boolean            mHighlightDrag;    // flag to highlight if dragged out and then back in
  52.  
  53. private:
  54.     Boolean            DroppedInTrash(LDragTask* inDragTask);
  55.     Boolean            CheckForOptionKey( DragReference inDragRef);
  56.     Boolean            CheckIfViewIsAlsoSender( DragReference inDragRef);
  57. };
  58.  
  59.     
  60.